﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AQK_FXM.aspx.cs" Inherits="TONLI.TJOA.Anquan.AQK_FXM" %>
<%@ Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>
<%@ Register TagPrefix="uc" TagName="AQK_FXM_Grid" Src="~/Control/AQK_FXM_Grid.ascx" %>
<%@ Register TagPrefix="uc" TagName="PickerAndCalendar" Src="~/Control/PickerAndCalendar.ascx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>安全月分析</title>
    <link href="~/common/toolbarStyle.css" type="text/css" rel="stylesheet" />
    <link href="~/common/folder_grid.css" rel="stylesheet" type="text/css" />
    <link href="~/common/dialog.css" rel="stylesheet" type="text/css" />
    <link href="~/common/treeviewStyle.css" rel="stylesheet" type="text/css" />
    <link href="~/common/splitterStyle.css" type="text/css" rel="stylesheet" />
    <link href="~/common/calendarStyle.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
    var txtArray;
    var nCols;
    var funcs;
    var parentid=null;
    var objEdit=null;
    var isNew=false;
    function init(){
    
        funcs = TONLI.TJOA.Control.AQK_FXM_Grid;
        
        nCols =2;
        txtArray =new Array();
        for(i=0;i<nCols;i++){
            txtArray[i] = document.getElementById('txt'+i);  
        }
        d=funcs.GetDate2().value;
     
        PickerAndCalendar1_Picker1_setDate(d);
        //query();
    }
    var bodyWidth;
    function resizeHeight(){
    }
    function add(){
        for(i=0;i<nCols;i++){
            txtArray[i].value="";
        }  
        objEdit =funcs.GetNew().value;
        txtArray[0].value = objEdit.NY;
        txtArray[1].value = objEdit.NY.substring(4,2)+"月份安全分析报告";
        if(objEdit){
            isNew=true;
            Dialog2.show();
        }
    }
    function edit(){
        objs =AQK_FXMGrid.getSelectedItems();
        if(objs && objs[0])
        {         
            temp_id=objs[0].getMember('SUID').get_value(); 
            
            objEdit =funcs.GetOne(temp_id).value
            
            if(objEdit){
                txtArray[0].value = objEdit.NY;
                txtArray[1].value = objEdit.TITLE;
                isNew=false;
                Dialog2.Show();
            }
        }        
    }
    
    function del(){
        objs =AQK_FXMGrid.getSelectedItems();
        if(objs && objs[0])
        {
            obj = objs[0];
            temp_id =obj.getMember('SUID').get_value();
            
            if(!confirm('确认删除所选记录吗？'))return;
            
            ret =funcs.Del(temp_id).value;
            
            if(ret==1)
            {
                AQK_FXMGrid.deleteItem(obj);
            }
            objs=null;
        }
    }
    function dialog2Ok(){ 
//    alert(1);
        objEdit.NY =txtArray[0].value
        objEdit.TITLE =txtArray[1].value
        if(!isNew){
            if(funcs.Update(objEdit).value){
                location.href="AQK_FXM_HtmlEdit.aspx?suid="+objEdit.SUID+"&col=content&table=tjoa_AQK_FXM&URL=AQK_FXM";
            }
        }else{    
            if(funcs.Add(objEdit).value){
                location.href="AQK_FXM_HtmlEdit.aspx?suid="+objEdit.SUID+"&col=content&table=tjoa_AQK_FXM&URL=AQK_FXM";
            }                    
        }
    }
    function dialog2Cancel(){
        Dialog2.close();
    }
    function query(){
     d = PickerAndCalendar1_Picker1_getDate();
     d2 =PickerAndCalendar2_Picker1_getDate();
     funcs.SetFilter(d,d2);
     AQK_FXMCallBack.callback("filter");
 }
    function query2(){
        objs =AQK_FXMGrid.getSelectedItems();
        if(objs && objs[0])
        {
            obj = objs[0];
            temp_id =obj.getMember('SUID').get_value()
            location.href="AQK_Html.aspx?suid="+temp_id +"&col=content&table=tjoa_aqk_fxm&URL=AQK_FXM";
        }   
    }    
</script>

</head>

<body  style="background-color: #e5f2ff; margin: 0px; overflow:hidden;" onload="init()"  >
    <form id="form1" runat="server" >
        <div  style="height:100%;" id="div1">
            <table style="width: 100%; " cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td class="h1" style="border-bottom: 1px solid #6593CF;">
                        <div style="width: 100%;">
                            <img id="FolderGridHeadingImage" src="../common/images/treeview/file.gif" alt="无图片" />
                            <div id="FolderGridHeadingText" style="display: inline; padding-left: 6px;">
                                安全管理\安全信息月分析</div>
                        </div>
                    </td>
                </tr>
                <tr class="TopToolBarBack">
                    <td style="height: 25px; padding-left: 1px; padding-top: 1px;">
                        <ComponentArt:ToolBar ID="ToolBar1" CssClass="TopToolBar" DefaultItemTextImageRelation="ImageBeforeText"
                            DefaultItemImageHeight="16" DefaultItemImageWidth="16" ImagesBaseUrl="../common/top_panel_images/"
                            ItemSpacing="0" Orientation="Horizontal" UseFadeEffect="false" runat="server">
                            <Items>
                                <ComponentArt:ToolBarItem CssClass="TopToolBarCustomItem" ItemType="Separator" ImageUrl="toolbar_end_left.gif"
                                    ImageWidth="7" ImageHeight="25" />
                                <ComponentArt:ToolBarItem CssClass="TopToolBarImageTextItem" HoverCssClass="TopToolBarImageTextItemHover"
                                    ActiveCssClass="TopToolBarImageTextItemActive" ImageUrl="reply.gif" Text="增加"
                                    ClientSideCommand="add()"></ComponentArt:ToolBarItem>
                                <ComponentArt:ToolBarItem CssClass="TopToolBarBreakItem" ItemType="Separator" ImageUrl="break.gif"
                                    ImageHeight="15" ImageWidth="2" />
                                <ComponentArt:ToolBarItem ActiveCssClass="TopToolBarImageTextItemActive" ClientSideCommand="edit()"
                                    CssClass="TopToolBarImageTextItem" HoverCssClass="TopToolBarImageTextItemHover"
                                    ImageUrl="reply.gif" Text="修改" />
                                <ComponentArt:ToolBarItem CssClass="TopToolBarImageTextItem" HoverCssClass="TopToolBarImageTextItemHover"
                                    ActiveCssClass="TopToolBarImageTextItemActive" ImageUrl="reply.gif" Text="删除"
                                    ClientSideCommand="del()"></ComponentArt:ToolBarItem>                                
                                <ComponentArt:ToolBarItem CssClass="TopToolBarBreakItem" ItemType="Separator" ImageUrl="break.gif"
                                    ImageHeight="15" ImageWidth="2" />
                                <ComponentArt:ToolBarItem CssClass="TopToolBarImageTextItem" HoverCssClass="TopToolBarImageTextItemHover"
                                    ActiveCssClass="TopToolBarImageTextItemActive" ImageUrl="reply.gif" Text="内容浏览"
                                    ClientSideCommand="query2()" Visible="true"></ComponentArt:ToolBarItem>
                                <ComponentArt:ToolBarItem CssClass="TopToolBarImageTextItem" HoverCssClass="TopToolBarImageTextItemHover"
                                    ActiveCssClass="TopToolBarImageTextItemActive" ImageUrl="reply.gif" Text="刷新"
                                    ClientSideCommand="query()" Visible="true"></ComponentArt:ToolBarItem>
                                <ComponentArt:ToolBarItem CssClass="TopToolBarCustomItem" ItemType="Separator" ImageUrl="toolbar_end_right.gif"
                                    ImageWidth="13" ImageHeight="25" />
                            </Items>
                        </ComponentArt:ToolBar>
                    </td>
                </tr>
                
                <tr>
                <td>
                <div>
                    <div>
                        <table style="width: 100%; " cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td width="120px">
                                    <uc:PickerAndCalendar ID="PickerAndCalendar1" runat="server" />
                                    
                                </td>
                                <td>
                                    <uc:PickerAndCalendar ID="PickerAndCalendar2" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </div>       
                    <uc:AQK_FXM_Grid ID="AQK_FXM_Grid1" runat="server"/> 
                </div>
                </td></tr>
                </table>
                <ComponentArt:Dialog  CssClass="dialog" AllowDrag="true" 
                Alignment="MiddleCentre" ID="Dialog2" runat="server" Width="356" Height="307"
                HeaderCssClass="dialog-smmuser"
	            ContentCssClass="dialog-smmuser"
                >
                <ClientEvents>
                </ClientEvents>
                <Header >
                    <div class="dialog-title draggable" onmousedown="Dialog2.StartDrag(event);">
			            <div class="left"></div>
			            <div class="mid">
				            <a class="close" href="javascript:void(0);" onclick="Dialog2.close();return false;"></a>
				            <span>对话框</span>
			            </div>
			            <div class="right"></div>
		            </div>
                </Header>
                <Content>
                    <div class="dialog-content">
                        <div class="left">
                        </div>
                        <div class="mid">
                            <table class="table" cellpadding="0" cellspacing="1">
                                <tr>
                                    <td class="td-lable"  >
                                        月份</td>
                                    <td>
                                        <input class="txt l400" id="txt0" type="text" maxlength="10" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td-lable" >
                                        标题</td>
                                    <td>
                                    <input class="txt l400" id="txt1" type="text" maxlength="50"  />
                                
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="right">
                        </div>
                    </div>
                    <div class="dialog-buttons">
                        <div class="left">
                        </div>
                        <div class="mid">
                            <a onclick="dialog2Cancel();return false;" href="javascript:void(0);" class="button-70 float-right">
                                <span>取消</span></a> <a onclick="dialog2Ok();return false;" href="javascript:void(0);"
                                    class="button-70 float-right"><span>确认</span></a>
                        </div>
                        <div class="right">
                        </div>
                    </div>
                </Content>
                
            </ComponentArt:Dialog>
    </div>
    </form>
</body>
</html>
